package io;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

/**
 * @author Cheng Jun
 * Description: 对象输出流（处理流），也有缓冲性质。
 * @version 1.0
 * @date 2022/8/14 14:43
 */
public class ObjectOutPutStreamExample {

    public static void main(String[] args) throws IOException {
        write();
    }

    private static void write() throws IOException {
        ObjectOutputStream objectOutputStream = new ObjectOutputStream(
                new FileOutputStream("src/io/TestFile/ForObjectInputStream.dat"));
        Student cauchy6317 = new Student("cauchy6317", 28);
        objectOutputStream.writeObject(cauchy6317);
        objectOutputStream.close();
    }
}
